package com.usian.admin;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.DigestUtils;
import springfox.documentation.schema.Entry;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class login {
    public static void main(String[] args) {
       /* String sa="123abc";
        String password="admin";
        String s = DigestUtils.md5DigestAsHex((password + sa).getBytes());
        System.out.println(s);*/
/*      String a="asdasd";
        System.out.println(a.indexOf(" "));
      if (a.indexOf(" ")!=-1){
          System.out.println("非法字符");
      }else {
          System.out.println("有效字符");
      }*/





                HashMap<String, Integer> map = new HashMap<>();
                map.put("jia", 1);
                map.put("dong", 2);
                map.put("lin", 3);

                //通过keySet()获取key
        Set<String> set = map.keySet();
        for (String s : set) {
            System.out.println(s+"/"+map.get(s));
        }
               System.out.println( "------------" );


        Set<Map.Entry<String, Integer>> entrySet = map.entrySet();
        for(Map.Entry<String, Integer> entry : entrySet) {
                    System.out.println(entry.getKey() + " " + entry.getValue());
                }
                System.out.println( "------------" );

                //通过values()取值
                Collection<Integer> values = map.values();
                for(Integer i : values)
                    System.out.println(i);
            }
        }


